package com.platform.wechat.mapper;

import com.platform.wechat.entity.Hospital;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
/**
* @Description: 医院信息表
* @Author: MaYongQiang
* @Date: 2021/7/28
* @time: 13:21
*/
@Repository
public interface HospitalMapper {

    /**
    * @Description: 查询所有医院信息
    * @Param: []
    * @return: java.util.List<com.platform.wechat.entity.Hospital>
    * @Author: YP
    * @Date: 2021/7/29
    * @Time: 11:23
    */
    List<Hospital> selectAllHospital(String hospitalAddress);

    /** 
    * @Description: 查询所有医院信息
    * @Param: []
    * @return: java.util.List<com.platform.wechat.entity.Hospital>
    * @Author: YP
    * @Date: 2021/8/3
    * @Time: 17:00
    */
    List<Hospital> selectAllHospitalToDistance();

    /**
     * 根据距离查询医院信息
     * @return
     */
    List<Hospital> selectAllSortByDistance();

    //模糊查询
    List<Hospital> vagueQuery( @Param("hospitalName") String hospitalName);

    int deleteByPrimaryKey(Integer hospitalId);

    int insert(Hospital record);

    int insertSelective(Hospital record);

    Hospital selectByPrimaryKey(Integer hospitalId);

    int updateByPrimaryKeySelective(Hospital record);

    int updateByPrimaryKey(Hospital record);

    /** 
    * @Description: 根据科室查询医院 
    * @Param: [officesName] 
    * @return: java.util.List<com.platform.wechat.entity.Hospital> 
    * @Author: guopeixin
    * @Date: 2021/7/31 10:28
    */
    List<Hospital> selectHospitalByofficesName(@Param("officesName") String officesName,@Param("hospitalAddress") String hospitalAddress, @Param("hospitalName") String hospitalName);

    /** 
    * @Description: 根据医院ID,科室ID查询医院信息及科室
    * @Param: [hospitalId, chiefofficesId]
    * @return: java.util.List<com.platform.wechat.entity.Hospital> 
    * @Author: guopeixin
    * @Date: 2021/7/31 16:15
    */
    List<Hospital> selectOfficesNameByHospitalId(@Param("hospitalId") Integer hospitalId, @Param("chiefofficesId") Integer chiefofficesId, @Param("officesId") Integer officesId, @Param("hospitalAddress") String hospitalAddress, @Param("officesName") String officesName, @Param("hospitalName") String hospitalName);

    /** 
    * @Description: 根据医院ID,科室名称查询一条信息
    * @Param: [hospitalId, officesName]
    * @return: com.platform.wechat.entity.Hospital 
    * @Author: guopeixin
    * @Date: 2021/8/1 16:26
    */
    Hospital selectOne(@Param("hospitalId") Integer hospitalId, @Param("officesName") String officesName, @Param("officesId") Integer officesId, @Param("hospitalAddress") String hospitalAddress, @Param("hospitalName") String hospitalName);

    /** 
    * @Date: 2021/8/2 23:27
    * @Author: guopeixin
    * @Description:  根据医院ID,科室ID查询一条信息
    */
    Hospital selectOneByONO(@Param("hospitalId") Integer hospitalId, @Param("officesId") Integer officesId);
}